package com.edu.imau.TParking;

import com.edu.imau.ParkingDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/TemporaryDelete")
public class TDeleteServlet extends HttpServlet {
    ParkingDao dao = new ParkingDao();
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //1:处理参数
        String t_id = request.getParameter("t_id");
        //2 调用model
        if(t_id != null){
            dao.deleteTemporary(Integer.parseInt(t_id));
            //3；展示数据View
            response.sendRedirect("Temporary.jsp");
        }
    }
}